<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name=viewport content="with=device-width,initial-scale=1.0">
<link href="resource/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<link href="resource/css/basic.css" rel="stylesheet">
<script src="resource/js/jquery.min.js"></script>
<script src="resource/bootstrap/js/bootstrap.min.js"></script>
<script src="resource/js/user.js"></script>
<script src="resource/js/lesson.js"></script>
<script>
	$(function() {
		$('#btnLogout').click(logout);
		$('#lessonType a[data-id]').click(getLessonListByType);
	});
</script>
<title>在线课程</title>
</head>
<body>
	<nav class="navbar navbar-fixed-top navbar-primary" role="navigation">
		<div class="container-fluid">
			<div class="navbar-header">
				<a href="index"><img class="img-responsive"
					src="resource/image/header3.png" /></a>
			</div>
			<ul class="nav navbar-nav">
				<li><a href="index"><i class="glyphicon glyphicon-home"></i>
						首 页</a></li>
				<li class="active"><a href="#"><i
						class="glyphicon glyphicon-book"></i> 在 线 课 程</a></li>
				<li><a href="resourceDown"><i
						class="glyphicon glyphicon-file"></i> 资 源 下 载</a></li>
				<li><a href="lessonTest"><i
						class="glyphicon glyphicon-pencil"></i> 课 程 测 试</a></li>
				<li><a href="clientDown"><i
						class="glyphicon glyphicon-phone"></i> 客 户 端</a></li>
				<li><a href="aboutUs"><i class="glyphicon glyphicon-globe"></i>
						关 于 我 们</a></li>
			</ul>
			<ul class="user nav navbar-nav navbar-right">
				<c:choose>
					<c:when test="${user != null }">
						<li><a href="#"><i class="glyphicon glyphicon-comment"></i>
								我 的 消 息</a></li>
						<li><a href="#"
							class="dropdown-toggle gropdown-block gropdown-primary"
							data-toggle="dropdown"> <img style="height: 18px"
								src="${user.logo }" /> ${user.petName} <span class="caret"></span>
						</a>
							<div class="dropdown-menu" role="menu">
								<div class="row">
									<div class="col-xs-6">
										<dl class="col-xs-offset-2">
											<dd>
												<img class="img-circle img-responsive" src="${user.logo }" />
											</dd>
											<dt class="text-center">
												<a class="list-default" target="view_window"
													href="userCenter"> ${user.petName }</a>
											</dt>
										</dl>
									</div>

									<div class="col-xs-6">
										<ul class="list-unstyled">
											<li class="list-block"><a target="view_window"
												href="userCenter"><i class="glyphicon glyphicon-home"></i>
													个 人 中 心</a></li>
											<li class="list-block"><a href="#"><i
													class="glyphicon glyphicon-comment"></i> 我 的 消 息</a></li>
											<li class="list-block"><a target="view_window"
												href="userInfo"><i class="glyphicon glyphicon-user"></i>
													信 息 编 辑 </a></li>
											<li class="list-block"><a target="view_window"
												href="userLesson"><i class="glyphicon glyphicon-book"></i>
													课 程 管 理</a></li>
											<li class="list-block"><a target="view_window"
												href="userExamResults"><i
													class="glyphicon glyphicon-pencil"></i> 成 绩 查 询</a></li>
											<li class="list-block"><a id="btnLogout" href="#"><i
													class="glyphicon glyphicon-off"></i> 退 出 登 录</a></li>
										</ul>
									</div>
								</div>
								<div role="row"></div>
							</div></li>
					</c:when>
					<c:otherwise>
						<li><a href="login"><i class="glyphicon glyphicon-user"></i>
								登 陆</a></li>
						<li><a href="regist"><i class="glyphicon glyphicon-cog"></i>
								注 册</a></li>
					</c:otherwise>
				</c:choose>
			</ul>
		</div>
	</nav>
	<div>
		<div id="lessonType" class="col-sm-2">
			<div class="row panel-group" id="accordion" role="tablist"
				aria-multiselectable="true">
				<div class="panel panel-default">
					<c:forEach items="${lessonType }" var="lessonType">
						<div class="panel-heading" role="tab">
							<h4 class="panel-title">
								<a class="list-block" data-toggle="collapse"
									data-parent="#accordion" href="#type${lessonType.id }">${lessonType.typeName }
									<span class="badge pull-right">${fn:length(lessonType.lessonTwoType)}</span>
								</a>
							</h4>
						</div>
						<div id="type${lessonType.id }" class="panel-collapse collapse">
							<div class="list-group">
								<c:forEach items="${lessonType.lessonTwoType}" var="item">
									<a class="list-group-item list-block" href="#"
										data-id="${item.id }">${item.typeName }</a>
								</c:forEach>
							</div>
						</div>
					</c:forEach>
				</div>
			</div>
		</div>
		<div class="col-sm-10">
			<div class="row panel panel-default">
				<div id="lessonList" class="panel-body">
					<c:forEach items="${lesson}" var="lesson">

						<dl class="col-sm-3">
							<dt>
								<a href="lessonInfo/${lesson.id }"><img
									class="img-responsive" src="${lesson.logo }" /></a>
							</dt>
							<dd>
								<a class="link-black" href="lessonInfo/${lesson.id }">${lesson.title }</a>
							</dd>
						</dl>
					</c:forEach>
				</div>
			</div>
		</div>
	</div>
	<footer class="col-sm-12 navbar navbar-inverse navbar-static-bottom">
		<div class="container-fluid">
			<br />
			<div class="row">
				<div class="col-sm-4 col-sm-offset-1">
					<h4>School Education</h4>
				</div>
				<div class="col-sm-4">
					<h4>关于我们</h4>
					<span class="col-xs-4"><a href="aboutUs">关于我们</a></span> <span
						class="col-xs-8"><a href="#">学校云</a></span> <span class="col-xs-4"><a
						href="#">联系我们</a></span> <span class="col-xs-8"><a href="#">常见问题</a></span>
					<span class="col-xs-4"><a href="#">意见反馈</a></span> <span
						class="col-xs-8"><a href="#">法律条款</a></span>
				</div>
				<div class="col-sm-3">
					<h4>关注我们</h4>
				</div>
			</div>
			<br />
			<p class="text-center">Copyright © 2015 SVTCC. All Rights
				Reserved.</p>
			<p class="text-center">四川交通职业技术学院 版权所有 | 四川交通职业技术学院在线课堂服务协议</p>
		</div>
	</footer>
</body>
</html>